#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(int argc, char * argv[],char * env[])
{
//  //printf("user:%s\n",getenv("USER"));
//  ///printf("user:%s\n",getenv("USER"));
//  printf("user:%s\n",getenv("USER"));
//  printf("user:%s\n",getenv("USER"));
//  printf("user:%s\n",getenv("USER"));
//  printf("user:%s\n",getenv("USER"));

//    char who[32];
//    strcpy(who,getenv("USER"));
//   if( strcmp(who,"root")==0)
//{printf("这是root用户，拥有全部权限");
//}
// else
//{ printf("这不是root，权限受限制");
//}

// if(argc>1)
//{  printf("usage:%s 选项：[a][b][c][d]\n",argv[0]);
//} 
//
//if(strcmp(argv[1],"-a")==0)
//{
// printf("功能1");
//}
//else if(strcmp(argv[1],"-b")==0)
//{
// printf("功能2");
//}
//else if(strcmp(argv[1],"-c")==0)
//{
// printf("功能3");
//}
//else if(strcmp(argv[1],"-d")==0)
//{
// printf("功能4");
//}
//else
//{printf("default功能");
//}
//  int i =0;
//for(;argv[i];i++)
//{printf("%s",argv[i]);
//} 
//   i =0;
//for(;env[i];i++)
//{printf("%s",env[i]);
//}
if(strcmp(argv[1],"cd")==0)
{
  chdir(argv[1]);
}
if(argc==2)
{
  chdir(argv[1]);
}
 return 0;
}
